package com.rongx.config;

import javax.sql.DataSource;

public class Environment {
    private final String id;
    private final DataSource dataSource;

    // 构造方法+Builder模式+getter
    public Environment(String id, DataSource dataSource) {
        this.id = id;
        this.dataSource = dataSource;
    }

    public static class Builder {
        private String id;
            private DataSource dataSource;

        public Builder(String id) {
            this.id = id;
        }

        public Builder dataSource(DataSource ds) {
            this.dataSource = ds;
            return this;
        }

        public Environment build() {
            return new Environment(id, dataSource);
        }
    }

    // getter方法
    public String getId() {
        return id;
    }

    public DataSource getDataSource() {
        return dataSource;
    }
}